t=i=0
liste=[]
while(t<1 or t>1000):
t=int(input())
for i in range(t):
s=input()
while(len(s)>50 or len(s)<1):
s=input()
liste.append(s)
for s in liste:
if s in 'Yes'*50 :
print('Yes')
else:
print('No')
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define ld long double
#define LM10 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ld long double
/*
bool f = false;
int cnt = 0 ;
int partition (int arr[] , int l , int h)
{
int p = arr[l] ;
int i= l ;
int j=h ;
while(i<j)
{
do {
{
i++ ;
}
}while (arr[i]<=p) ;
do {
j-- ;
}while(arr[j]>p) ;
if(i<j)
{
swap(arr[i],arr[j]) ;
f=true ;
}
}
if (f)
cnt++ ;
swap(arr[l],arr[j]) ;
return j ;
}
void quicksort (int arr[], int left , int right)
{
if (left<right)
{
int piv = partition(arr , left ,right) ;
quicksort(arr,left,piv) ;
quicksort(arr,piv+1,right) ;
}
}
*/
/*
int n , m , cnt = 0 ;
ll s = 0 ,sum = 0 ;
void solve() {
cin>>n>>m ;
ll bytesComp [10004]={};
while(n--)
{
int a , b ;
cin>>a>>b ;
s+=a;
bytesComp[cnt] = a-b ;
cnt++ ;
}
bool f = false ;
sort(bytesComp , bytesComp+cnt) ;
for (int i = 0; i < cnt; ++i) {
cout<<bytesComp[i]<<' ';
}
cout<<"\n" ;
for (int i = 0; i < cnt; ++i) {
sum+= bytesComp[i] ;
if (sum==s-m){
cout<<i ;
f=true ;
break;
}
}
if (f==false)
cout<<-1 ;
}
*/
int main(void)
{
LM10
int tt ;
cin>>tt ;
while(tt--)
{
string s ;
cin>>s ;
string t="YesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYesYes" ;
if (t.find(s)!=t.npos)
cout<<"YES\n" ;
else
cout<<"NO\n" ;
}
}
HRDSEQ Hard Sequence | DRCHEF Doctor Chef |
559. Maximum Depth of N-ary Tree | 821. Shortest Distance to a Character |
1441. Build an Array With Stack Operations | 1356. Sort Integers by The Number of 1 Bits |
922. Sort Array By Parity II | 344. Reverse String |
1047. Remove All Adjacent Duplicates In String | 977. Squares of a Sorted Array |
852. Peak Index in a Mountain Array | 461. Hamming Distance |
1748. Sum of Unique Elements | 897. Increasing Order Search Tree |
905. Sort Array By Parity | 1351. Count Negative Numbers in a Sorted Matrix |
617. Merge Two Binary Trees | 1450. Number of Students Doing Homework at a Given Time |
700. Search in a Binary Search Tree | 590. N-ary Tree Postorder Traversal |
589. N-ary Tree Preorder Traversal | 1299. Replace Elements with Greatest Element on Right Side |
1768. Merge Strings Alternately | 561. Array Partition I |
1374. Generate a String With Characters That Have Odd Counts | 1822. Sign of the Product of an Array |
1464. Maximum Product of Two Elements in an Array | 1323. Maximum 69 Number |
832. Flipping an Image | 1295. Find Numbers with Even Number of Digits |